package com.shaobufan.museum.controllar;

import com.shaobufan.museum.common.BaseResponse;
import com.shaobufan.museum.common.ResultUtils;
import com.shaobufan.museum.pojo.entity.Moment;
import com.shaobufan.museum.service.MomentService;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/moment")
public class MomentController {
    @Resource
    MomentService momentService;

    @ApiOperation("获取所有时刻")
    @GetMapping("/all")
    public BaseResponse<List<Moment>> getAllMoment() {
        List<Moment> momentList = momentService.getAllMoment();
        return ResultUtils.success(momentList, "所有时刻");
    }
}
